<!DOCTYPE html>












  


<html class="theme-next pisces use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">






  
  
  <link rel="stylesheet" href="/lib/fancybox/source/jquery.fancybox.css">



<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":true},
    copycode: {"enable":true,"show_result":true,"style":null},
    fancybox: true,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: 'search.xml'
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="简介这是一份关于证书安装的教程，采用electron去实现跨平台证书安装。 shell 命令">
<meta name="keywords" content="react,electron,shell">
<meta property="og:type" content="article">
<meta property="og:title" content="Electron-cer 跨平台证书安装">
<meta property="og:url" content="https://blog.youngzk.com/posts/554d6708/index.html">
<meta property="og:site_name" content="Muniz Blog">
<meta property="og:description" content="简介这是一份关于证书安装的教程，采用electron去实现跨平台证书安装。 shell 命令">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-07-28T05:22:54.711Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Electron-cer 跨平台证书安装">
<meta name="twitter:description" content="简介这是一份关于证书安装的教程，采用electron去实现跨平台证书安装。 shell 命令">





  
  
  <link rel="canonical" href="https://blog.youngzk.com/posts/554d6708/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>Electron-cer 跨平台证书安装 | Muniz Blog</title>
  






  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?502753d7b083822cd84ffc61132a5ac4";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>







  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Muniz Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-books">

    
    
      
    

    

    <a href="/books" rel="section"><i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br>阅读</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>

      
      
        <li class="menu-item menu-item-search">
          <a href="javascript:;" class="popup-trigger">
          
            <i class="menu-item-icon fa fa-search fa-fw"></i> <br>搜索</a>
        </li>
      
    </ul>
  

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://blog.youngzk.com/posts/554d6708/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="修心">
      <meta itemprop="description" content="修不被别人影响的心，修不被自己控制的心，修不被别人诱惑的心。">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Muniz Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Electron-cer 跨平台证书安装

              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2018-11-25 17:16:23" itemprop="dateCreated datePublished" datetime="2018-11-25T17:16:23+08:00">2018-11-25</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2019-07-28 13:22:54" itemprop="dateModified" datetime="2019-07-28T13:22:54+08:00">2019-07-28</time>
              </span>
            
          

          

          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
                 阅读次数： 
                <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>
              </span>
            </span>
          

          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h3><p>这是一份关于证书安装的教程，采用<strong>electron</strong>去实现跨平台证书安装。</p>
<h3 id="shell-命令"><a href="#shell-命令" class="headerlink" title="shell 命令"></a>shell 命令</h3><a id="more"></a>

<h4 id="mac"><a href="#mac" class="headerlink" title="mac"></a>mac</h4><p>列出证书</p>
<blockquote>
<p>sudo security dump-keychain /Library/Keychains/System.keychain</p>
</blockquote>
<p>安装证书</p>
<blockquote>
<p>sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/cer.crt</p>
</blockquote>
<p>删除证书</p>
<blockquote>
<p>sudo security delete-certificate -c “OK Group Certificate Authority”</p>
</blockquote>
<h4 id="linux"><a href="#linux" class="headerlink" title="linux"></a>linux</h4><p>列出证书</p>
<blockquote>
<p>ls /usr/local/share/ca-certificates/</p>
</blockquote>
<p>安装证书</p>
<blockquote>
<p>拷贝证书到【目录：/usr/local/share/ca-certificates/】<br>命令： sudo cp cer.crt /usr/local/share/ca-certificates/foo.crt<br>更新CA证书数据库存储：sudo update-ca-certificates</p>
</blockquote>
<p>删除证书</p>
<blockquote>
<p>把证书从【目录：/usr/local/share/ca-certificates/】中删除<br>命令： sudo rm /usr/local/share/ca-certificates/cer.crt<br>更新CA证书数据库存储：sudo update-ca-certificates –fresh</p>
</blockquote>
<h4 id="linux-centos-6"><a href="#linux-centos-6" class="headerlink" title="linux (centos 6)"></a>linux (centos 6)</h4><p>列出证书</p>
<blockquote>
<p>ls /etc/pki/ca-trust/source/anchors/</p>
</blockquote>
<p>安装证书</p>
<blockquote>
<p>安装ca-certificates包： yum install ca-certificates<br>启用动态CA配置功能： update-ca-trust force-enable<br>将其作为新文件添加到【目录：/etc/pki/ca-trust/source/anchors/】 中<br>命令：cp OK_Group_OA.crt /etc/pki/ca-trust/source/anchors/<br>更新证书存储：update-ca-trust extract</p>
</blockquote>
<p>删除证书</p>
<blockquote>
<p>把证书从【目录：/etc/pki/ca-trust/source/anchors/】中删除<br>命令： sudo rm /etc/pki/ca-trust/source/anchors/cer.crt<br>更新CA证书数据库存储：sudo update-ca-trust extract</p>
</blockquote>
<h4 id="linux-centos-5"><a href="#linux-centos-5" class="headerlink" title="linux (centos 5)"></a>linux (centos 5)</h4><p>列出证书</p>
<blockquote>
<p>列出证书功能 需要去 <strong>ca-bundle.crt</strong> 文件中查看。</p>
</blockquote>
<p>安装证书</p>
<blockquote>
<p>把可信证书附加到【文件：/etc/pki/tls/certs/ca-bundle.crt】 中，也就是追加到文本末尾<br>命令：cat OK_Group_OA.crt &gt;&gt;/etc/pki/tls/certs/ca-bundle.crt</p>
</blockquote>
<p>删除证书</p>
<blockquote>
<p>把 OK_Group_OA.crt 的内容删除掉，即可。<br>vim /etc/pki/tls/certs/ca-bundle.crt<br>删除完， :wq 保存 </p>
</blockquote>
<h4 id="windows-10-windows-7"><a href="#windows-10-windows-7" class="headerlink" title="windows-10 || windows-7"></a>windows-10 || windows-7</h4><p>列出证书</p>
<blockquote>
<p>cmd 运行 certmgr.msc</p>
</blockquote>
<p>安装证书</p>
<blockquote>
<p>certutil -addstore -f “ROOT” cer.crt</p>
</blockquote>
<p>删除证书</p>
<blockquote>
<p>certutil -delstore “ROOT” serial-number-hex</p>
</blockquote>
<h3 id="安装证书核心代码"><a href="#安装证书核心代码" class="headerlink" title="安装证书核心代码"></a>安装证书核心代码</h3><p>证书类，提供了安装证书的功能，内部去判断所在的操作系统。</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> &#123; app &#125; = <span class="built_in">require</span>(<span class="string">'electron'</span>);</span><br><span class="line"><span class="keyword">import</span> sudo <span class="keyword">from</span> <span class="string">'sudo-prompt'</span>;</span><br><span class="line"><span class="keyword">import</span> &#123; throwError &#125; <span class="keyword">from</span> <span class="string">'rxjs'</span>;</span><br><span class="line"><span class="keyword">const</span> os = <span class="built_in">require</span>(<span class="string">'os'</span>);</span><br><span class="line"><span class="keyword">const</span> path = <span class="built_in">require</span>(<span class="string">'path'</span>);</span><br><span class="line"><span class="keyword">const</span> fs = <span class="built_in">require</span>(<span class="string">'fs-extra'</span>);</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">default</span> <span class="class"><span class="keyword">class</span> <span class="title">InstallCer</span> </span>&#123;</span><br><span class="line">    platform = os.type().toLowerCase();</span><br><span class="line">    cerPath = path.resolve(__dirname, <span class="string">'../assets/cers'</span>, <span class="string">'cer.crt'</span>);</span><br><span class="line">    configDir = app.getPath(<span class="string">'userData'</span>);</span><br><span class="line">    assetsDir = path.resolve(<span class="keyword">this</span>.configDir, <span class="string">'assets/'</span>)</span><br><span class="line">    <span class="keyword">constructor</span>()&#123;</span><br><span class="line">        <span class="built_in">console</span>.log(<span class="string">'证书路径：'</span>, <span class="keyword">this</span>.cerPath);</span><br><span class="line">        <span class="built_in">console</span>.log(<span class="string">'实例化成功,当前系统：'</span>, <span class="keyword">this</span>.platform);</span><br><span class="line">        <span class="built_in">console</span>.log(<span class="string">'用户目录：'</span>, <span class="keyword">this</span>.configDir);</span><br><span class="line">        <span class="keyword">this</span>.init();</span><br><span class="line">    &#125;</span><br><span class="line">    init()&#123;</span><br><span class="line">        fs.ensureDirSync(<span class="keyword">this</span>.assetsDir);</span><br><span class="line">        <span class="keyword">try</span> &#123;</span><br><span class="line">            fs.copySync(<span class="keyword">this</span>.cerPath, <span class="string">`<span class="subst">$&#123;<span class="keyword">this</span>.assetsDir&#125;</span>/cer.crt`</span>);</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">'拷贝证书成功'</span>);</span><br><span class="line">        &#125; <span class="keyword">catch</span> (err) &#123;</span><br><span class="line">           <span class="keyword">throw</span> err;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">// mac 系统安装证书</span></span><br><span class="line">    darwin()&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="string">`security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "<span class="subst">$&#123;<span class="keyword">this</span>.assetsDir&#125;</span>/cer.crt"`</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">// windows 系统安装证书</span></span><br><span class="line">    windows_nt()&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="string">`certutil -addstore -f "ROOT" "<span class="subst">$&#123;<span class="keyword">this</span>.assetsDir&#125;</span>/cer.crt"`</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    runCer()&#123;</span><br><span class="line">        <span class="keyword">const</span> command = <span class="keyword">this</span>[<span class="keyword">this</span>.platform]();</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">new</span> <span class="built_in">Promise</span>(<span class="function"><span class="keyword">function</span>(<span class="params">resolve,reject</span>)</span>&#123;</span><br><span class="line">            sudo.exec(</span><br><span class="line">                command,</span><br><span class="line">                &#123;</span><br><span class="line">                  name: <span class="string">'OK Network Assistant'</span>,</span><br><span class="line">                  icns: path.resolve(__dirname, <span class="string">'../assets/'</span>, <span class="string">'icon.icns'</span>)</span><br><span class="line">                &#125;,</span><br><span class="line">                <span class="function"><span class="keyword">function</span>(<span class="params">error</span>) </span>&#123;</span><br><span class="line">                    <span class="keyword">if</span> (error) &#123;</span><br><span class="line">                        reject(error)</span><br><span class="line">                    &#125; <span class="keyword">else</span>&#123;</span><br><span class="line">                        resolve(<span class="literal">true</span>);</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            );</span><br><span class="line">        &#125;)</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="坑无敌"><a href="#坑无敌" class="headerlink" title="坑无敌"></a>坑无敌</h3><h4 id="shell读取assar-资源"><a href="#shell读取assar-资源" class="headerlink" title="shell读取assar 资源"></a>shell读取assar 资源</h4><p>问题：</p>
<p>在进行安装时，出现了读取资源失败的问题。通过查阅官方文案，发现时assar中的资源不支持通过<strong>shell管道</strong>的形式获取资源。</p>
<p>解决：</p>
<p>在进行安装时，先吧=把资源从<strong>assar</strong>中拷贝到assar外的目录下。这里我吧目录放在了用户目录下，通过 <strong>app.getPath(‘userData’)</strong> 该方法去获取每个操作系统的用户目录。</p>
<h4 id="开发与运行环境对文件的依赖"><a href="#开发与运行环境对文件的依赖" class="headerlink" title="开发与运行环境对文件的依赖"></a>开发与运行环境对文件的依赖</h4><p>问题：</p>
<p>由于路径在开发与运行时都是相对的一个路径，所以在打包后，运行时无法找到icon\证书等文件。</p>
<p>解决：</p>
<p>在开发时提供一份资源目录，生成环境打包的地方再次提供一份目录，目前虽然解决。但是还是需要升级下解决方案！</p>
<h4 id="安装证书成功、失败、强制安装新证书"><a href="#安装证书成功、失败、强制安装新证书" class="headerlink" title="安装证书成功、失败、强制安装新证书"></a>安装证书成功、失败、强制安装新证书</h4><p>问题：<br>在安装了证书的用户电脑上，如果重新安装时，是无法进行安装的。</p>
<p>解决：<br>使用<strong>electron-store</strong>数据配置模块，去记录该电脑的操作。如果用户安装了就保存value:1，失败为2。但是如果再次发布新的版本时，安装成功的value值就需要重新改变。该值计次叠加！</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">componentDidMount() &#123;</span><br><span class="line">    <span class="keyword">if</span> ([<span class="literal">undefined</span>, <span class="number">2</span>, <span class="number">1</span>].includes(store.get(<span class="string">'isInstallCer'</span>))) &#123;</span><br><span class="line">      <span class="keyword">this</span>.time = setTimeout(<span class="function"><span class="params">()</span> =&gt;</span> &#123;</span><br><span class="line">        <span class="keyword">this</span>.handleSearch();</span><br><span class="line">        clearTimeout(<span class="keyword">this</span>.time);</span><br><span class="line">      &#125;, <span class="number">1000</span>);</span><br><span class="line">    &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">      <span class="keyword">this</span>.props.history.push(routes.COUNTER)</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>

<p>在这，我把每次安装成功使用过的值都放入<strong>[undefined, 2, 1]</strong>这里。使得每次发布的新版本。用户在使用时可以安装到心得证书！</p>

      
    </div>

    
      

  <div class="popular-posts-header">相关文章推荐</div>
  <ul class="popular-posts">
  
    <li class="popular-posts-item">
      
      
      <div class="popular-posts-title"><a href="/posts/751f2370/" rel="bookmark">D3 数据可视化</a></div>
      
    </li>
  
    <li class="popular-posts-item">
      
      
      <div class="popular-posts-title"><a href="/posts/e39f5ecb/" rel="bookmark">Electron 应用 （爱翻译）</a></div>
      
    </li>
  
  </ul>


    

    
      
    

    
    
    

    

    
      
    
    

    
      <div>
        




  



<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>修心</li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    
    <a href="https://blog.youngzk.com/posts/554d6708/" title="Electron-cer 跨平台证书安装">https://blog.youngzk.com/posts/554d6708/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh-CN" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！</li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/react/" rel="tag"># react</a>
          
            <a href="/tags/electron/" rel="tag"># electron</a>
          
            <a href="/tags/shell/" rel="tag"># shell</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/posts/751f2370/" rel="next" title="D3 数据可视化">
                <i class="fa fa-chevron-left"></i> D3 数据可视化
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/posts/5da3d5f3/" rel="prev" title="okcoin-cli 辅助">
                okcoin-cli 辅助 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>

  </div>


          </div>
          
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
    <a href="/">
      <img class="site-author-image" itemprop="image" src="/images/avatar.jpg" alt="修心">
      </a>
  
  <p class="site-author-name" itemprop="name">修心</p>
  <div class="site-description motion-element" itemprop="description">修不被别人影响的心，修不被自己控制的心，修不被别人诱惑的心。</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">17</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">20</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>







  <div class="links-of-author motion-element">
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://github.com/1160007652" title="GitHub &rarr; https://github.com/1160007652" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="mailto:1160007652@qq.com" title="E-Mail &rarr; mailto:1160007652@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
    
  </div>



  <div class="cc-license motion-element" itemprop="license">
  
  
    
  
  
  
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh-CN" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>





          
          
        </div>
      </div>

      
      <!--noindex-->
        <div class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
            
            
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#简介"><span class="nav-number">1.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#shell-命令"><span class="nav-number">2.</span> <span class="nav-text">shell 命令</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#mac"><span class="nav-number">2.1.</span> <span class="nav-text">mac</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#linux"><span class="nav-number">2.2.</span> <span class="nav-text">linux</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#linux-centos-6"><span class="nav-number">2.3.</span> <span class="nav-text">linux (centos 6)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#linux-centos-5"><span class="nav-number">2.4.</span> <span class="nav-text">linux (centos 5)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#windows-10-windows-7"><span class="nav-number">2.5.</span> <span class="nav-text">windows-10 || windows-7</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装证书核心代码"><span class="nav-number">3.</span> <span class="nav-text">安装证书核心代码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#坑无敌"><span class="nav-number">4.</span> <span class="nav-text">坑无敌</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#shell读取assar-资源"><span class="nav-number">4.1.</span> <span class="nav-text">shell读取assar 资源</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#开发与运行环境对文件的依赖"><span class="nav-number">4.2.</span> <span class="nav-text">开发与运行环境对文件的依赖</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装证书成功、失败、强制安装新证书"><span class="nav-number">4.3.</span> <span class="nav-text">安装证书成功、失败、强制安装新证书</span></a></li></ol></li></ol></div>
            

          </div>
        </div>
      <!--/noindex-->
      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2018 – <span itemprop="copyrightYear">2019</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">修心</span>

  

  
</div>

<div>
  修不被别人影响的心，修不被自己控制的心，修不被别人诱惑的心。
</div>









        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="post-meta-item-icon">
      <i class="fa fa-user"></i>
    </span>
    <span class="site-uv" title="总访客量">
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
    </span>
  

  
    <span class="post-meta-divider">|</span>
  

  
    <span class="post-meta-item-icon">
      <i class="fa fa-eye"></i>
    </span>
    <span class="site-pv" title="总访问量">
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
    </span>
  
</div>









        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>






  











  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/fancybox/source/jquery.fancybox.pack.js"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>



  
  <script src="/js/scrollspy.js?v=7.2.0"></script>
<script src="/js/post-details.js?v=7.2.0"></script>



  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  













  <script src="/js/local-search.js?v=7.2.0"></script>












<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>








  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/hijiki.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":true},"react":{"opacity":0.7},"log":false});</script></body>
</html>
